<%@ page language="java" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/struts-tiles" prefix="tiles" %>
<%@ taglib uri="/tags/faare" prefix="fa" %>

<HTML>
    <HEAD>
        <TITLE>Application menu and body</TITLE>
        <LINK rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css/standard.css" />
    </HEAD>
    <BODY style="margin: 0; overflow: auto;" class="body_background">
        <!-- #### Horizontal Menu #### -->
        <TABLE cellpadding="0" cellspacing="0" border="0" width="100%" summary="Menu and body" class="body">
           <TR class="background">
              <TD><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="1" height="45" border="0" alt=""></TD>
              <TD width="100%">
                 <TABLE cellpadding="0" cellspacing="0" width="100%" border="0" summary="Top menu icons">
                    <TR>
                       <fa:getMenu id="Hmenu" name="horizontal_menu" />
                       <logic:iterate id="elt" name="Hmenu" property="elements">
                          <TD><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="24" height="1" alt="" border="0"></TD>
                          <TD align="center">
                             <fa:showMenuElement name="elt" style="" basecontext="page"  />
                          </TD>
                       </logic:iterate>
                    </TR>
                 </TABLE>
              </TD>
              <TD align="center">
                 <html:link action="/showPerson" paramId="dn" paramName="user" paramProperty="dn" target="_self">
                    <NOBR>&nbsp;&nbsp;&nbsp;<bean:write name="user" property="commonName" />&nbsp;&nbsp;&nbsp;</NOBR>
                 </html:link>
                 <IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="1" height="8" border="0" alt=""><BR/>
                 <logic:empty name="user" property="profile">
                    <NOBR>&nbsp;&nbsp;&nbsp;Standard profile&nbsp;&nbsp;&nbsp;</NOBR>
                 </logic:empty>
                 <logic:notEmpty name="user" property="profile">
				    <logic:notEqual name="user" property="profile" value="User">
                    <html:link action="/showProfile" paramId="dn" paramName="user" paramProperty="dn" target="_parent">
                       <NOBR>&nbsp;&nbsp;&nbsp;<bean:write name="user" property="profile" />&nbsp;&nbsp;&nbsp;</NOBR>
                    </html:link>
					</logic:notEqual>
					<logic:equal name="user" property="profile" value="User">
                       <NOBR>&nbsp;&nbsp;&nbsp;<bean:write name="user" property="profile" />&nbsp;&nbsp;&nbsp;</NOBR>
					</logic:equal>
                 </logic:notEmpty>
              </TD>
           </TR>
           <TR style="background-image: url('<%=request.getContextPath()%>/images/top_background_01.gif');">
              <TD><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="1" height="20" border="0" alt=""></TD>
              <TD width="100%" valign="middle"></TD>
              <TD width="100%" valign="middle"></TD>
           </TR>
        </TABLE>


        <TABLE cellpadding="0" cellspacing="20" border="0" align="center" width="100%" summary="Body" class="body">
           <TR>
		      <TD valign="top">
			
				 <logic:notPresent name="cartname">
		<TABLE cellpadding="0" cellspacing="20" border="0" align="center" width="100%" summary="Body" class="body">
            <TR><TD valign="top">
                    <TABLE cellpadding="0" cellspacing="0" border="0" width="60%" align="center" summary="Body" class="body">
                        <TR><TD width="100%">
                                <TABLE cellpadding="0" cellspacing="0" border="0" summary="bottom" align="center">
                                    <TR><TD><IMG src="<%=request.getContextPath()%>/images/top_left_selected.gif" width="6" height="6" alt=""></TD>
                                        <TD class="background" width="100%"><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="100" height="1" alt=""></TD>
                                        <TD><IMG src="<%=request.getContextPath()%>/images/top_right_selected.gif" width="6" height="6" alt=""></TD>
                                    </TR>
                                </TABLE>
                            </TD>
                        </TR>
                        <TR><TD class="background">
                                <DIV style="margin-left: 15; margin-right: 15;">
                                    <DIV class="white_title" style="margin-top: 10;">Users&nbsp;list</DIV>
                                    <DIV><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="1" height="15" alt=""></DIV>
                                    <TABLE cellpadding="0" cellspacing="0" border="0" summary="Quick search" align="center" class="body" width="100%">
                                        <TR><TD><IMG src="<%=request.getContextPath()%>/images/error.gif" alt="error"></TD>
                                            <TD><NOBR>The temporary list is empty!</NOBR></TD>
                                        </TR>
                                    </TABLE>
                                    <BR/>
                                </DIV>
                            </TD>
                        </TR>
                        <TR><TD><TABLE cellpadding="0" cellspacing="0" border="0" summary="bottom" align="center">
                                    <TR><TD><IMG src="<%=request.getContextPath()%>/images/bottom_left_selected.gif" width="6" height="6" alt=""></TD>
                                        <TD class="background" width="100%"><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="100" height="1" alt=""></TD>
                                        <TD><IMG src="<%=request.getContextPath()%>/images/bottom_right_selected.gif" width="6" height="6" alt=""></TD>
                                    </TR>
                                </TABLE>
                            </TD>
                        </TR>
                    </TABLE>
                </TD>
                <TD valign="top" width="200">
                    <BR/>
                </TD>
            </TR>
        </TABLE>
				</logic:notPresent>
				
			     <logic:present name="cartname">
		  		    <bean:define id="cartname" name="cartname" type="java.lang.String" />

				 <logic:notPresent name="<%=cartname %>" scope="session">
		<TABLE cellpadding="0" cellspacing="20" border="0" align="center" width="100%" summary="Body" class="body">
            <TR><TD valign="top">
                    <TABLE cellpadding="0" cellspacing="0" border="0" width="60%" align="center" summary="Body" class="body">
                        <TR><TD width="100%">
                                <TABLE cellpadding="0" cellspacing="0" border="0" summary="bottom" align="center">
                                    <TR><TD><IMG src="<%=request.getContextPath()%>/images/top_left_selected.gif" width="6" height="6" alt=""></TD>
                                        <TD class="background" width="100%"><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="100" height="1" alt=""></TD>
                                        <TD><IMG src="<%=request.getContextPath()%>/images/top_right_selected.gif" width="6" height="6" alt=""></TD>
                                    </TR>
                                </TABLE>
                            </TD>
                        </TR>
                        <TR><TD class="background">
                                <DIV style="margin-left: 15; margin-right: 15;">
                                    <DIV class="white_title" style="margin-top: 10;">Users&nbsp;list</DIV>
                                    <DIV><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="1" height="15" alt=""></DIV>
                                    <TABLE cellpadding="0" cellspacing="0" border="0" summary="Quick search" align="center" class="body" width="100%">
                                        <TR><TD><IMG src="<%=request.getContextPath()%>/images/error.gif" alt="error"></TD>
                                            <TD><NOBR>The temporary list is empty!</NOBR></TD>
                                        </TR>
                                    </TABLE>
                                    <BR/>
                                </DIV>
                            </TD>
                        </TR>
                        <TR><TD><TABLE cellpadding="0" cellspacing="0" border="0" summary="bottom" align="center">
                                    <TR><TD><IMG src="<%=request.getContextPath()%>/images/bottom_left_selected.gif" width="6" height="6" alt=""></TD>
                                        <TD class="background" width="100%"><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="100" height="1" alt=""></TD>
                                        <TD><IMG src="<%=request.getContextPath()%>/images/bottom_right_selected.gif" width="6" height="6" alt=""></TD>
                                    </TR>
                                </TABLE>
                            </TD>
                        </TR>
                    </TABLE>
                </TD>
                <TD valign="top" width="200">
                    <BR/>
                </TD>
            </TR>
        </TABLE>
				</logic:notPresent>

				<logic:present name="<%=cartname %>" scope="session">
				<bean:size id = "nbRes" name="<%=cartname %>"  /> 
				    <logic:equal name="nbRes" value="0">
		<TABLE cellpadding="0" cellspacing="20" border="0" align="center" width="100%" summary="Body" class="body">
            <TR><TD valign="top">
                    <TABLE cellpadding="0" cellspacing="0" border="0" width="60%" align="center" summary="Body" class="body">
                        <TR><TD width="100%">
                                <TABLE cellpadding="0" cellspacing="0" border="0" summary="bottom" align="center">
                                    <TR><TD><IMG src="<%=request.getContextPath()%>/images/top_left_selected.gif" width="6" height="6" alt=""></TD>
                                        <TD class="background" width="100%"><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="100" height="1" alt=""></TD>
                                        <TD><IMG src="<%=request.getContextPath()%>/images/top_right_selected.gif" width="6" height="6" alt=""></TD>
                                    </TR>
                                </TABLE>
                            </TD>
                        </TR>
                        <TR><TD class="background">
                                <DIV style="margin-left: 15; margin-right: 15;">
                                    <DIV class="white_title" style="margin-top: 10;">Users&nbsp;list</DIV>
                                    <DIV><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="1" height="15" alt=""></DIV>
                                    <TABLE cellpadding="0" cellspacing="0" border="0" summary="Quick search" align="center" class="body" width="100%">
                                        <TR><TD><IMG src="<%=request.getContextPath()%>/images/error.gif" alt="error"></TD>
                                            <TD><NOBR>The temporary list is empty!</NOBR></TD>
                                        </TR>
                                    </TABLE>
                                    <BR/>
                                </DIV>
                            </TD>
                        </TR>
                        <TR><TD><TABLE cellpadding="0" cellspacing="0" border="0" summary="bottom" align="center">
                                    <TR><TD><IMG src="<%=request.getContextPath()%>/images/bottom_left_selected.gif" width="6" height="6" alt=""></TD>
                                        <TD class="background" width="100%"><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="100" height="1" alt=""></TD>
                                        <TD><IMG src="<%=request.getContextPath()%>/images/bottom_right_selected.gif" width="6" height="6" alt=""></TD>
                                    </TR>
                                </TABLE>
                            </TD>
                        </TR>
                    </TABLE>
                </TD>
                <TD valign="top" width="200">
                    <BR/>
                </TD>
            </TR>
        </TABLE>
					</logic:equal>

					<logic:notEqual name="nbRes" value="0">
					<script>

                                 function checkCancelAll()
								 {
									for (var i=0; i<document.viewcart.elements.length; i++)
									{
									   var e=document.viewcart.elements[i];
                                       if ((e.name != 'allbox') && (e.type=='checkbox'))
									   {
										   if (document.viewcart.allBox.checked)
										   {
											   e.checked=true;
										   }
										   else
										   {
											   e.checked=false;
										   }
									   }
									}

								 }

								 function changeAction(action)
								 {
                                     if (action == 'delete')
									 {
										 document.viewcart.action="<%=request.getContextPath()%>/deleteFromCart.do";
										 document.viewcart.submit();
									 }
									 else if (action == 'trombi')
                                     {
										 document.viewcart.action="<%=request.getContextPath()%>/showTrombi.do";
										 document.viewcart.submit();
									 }
							     }

							  </script>

				    </script>
					<form name="viewcart" method="POST" target="_self">
                       <TABLE cellpadding="0" cellspacing="0" border="0" width="70%" class="body">
                          <TR>
						     <TD width="100%">
                                <TABLE cellpadding="0" cellspacing="0" border="0" align="center">
                                   <TR>
								      <TD><IMG src="<%=request.getContextPath()%>/images/top_left_selected.gif" width="6" height="6" alt=""></TD>
                                      <TD class="background" width="100%"><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="100" height="1" alt=""></TD>
                                      <TD><IMG src="<%=request.getContextPath()%>/images/top_right_selected.gif" width="6" height="6" alt=""></TD>
                                   </TR>
                                </TABLE>
                             </TD>
                          </TR>
                          <TR>
						     <TD class="background">
                                <DIV style="margin-left: 15;">
                                   <DIV class="white_title" style="margin-top: 10;">Users&nbsp;List</DIV>
                                   <DIV><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="1" height="1" alt=""></DIV>
                                   <TABLE cellpadding="0" cellspacing="0" border="0" class="body" width="100%">
								      <TR>
									     <TD width="20%">&nbsp;</TD>
									     <TD>&nbsp;</TD>
										 <TD>&nbsp;</TD>
                                         <TD width="100%">
                                            <input type="checkbox" name="allBox" title="Select or cancel the selection of all the displayed entries" alt="Select-Cancel" onclick="checkCancelAll()" />
										 </TD>
                                      </TR>
                                   <logic:iterate id="tempList" indexId="searchNum" name="<%=cartname %>"  scope="session">
                                      <TR>
									     <TD width="20%">&nbsp;</TD>
									     <TD><bean:write name="tempList" property="name"/>&nbsp;<bean:write name="tempList" property="givenName"/>&nbsp;</TD>
										 <TD>:&nbsp;</TD>
                                         <TD width="80%">
										       <input type="checkbox" name="eltindex" value="<%=searchNum%>" title="Select or cancel the selection of the entry" alt="Select-Cancel" />
										 </TD>
                                      </TR>
                                   </logic:iterate> 
                                   </TABLE>
                                   <BR/>
                                </DIV>
                             </TD>
                          </TR>
                          <INPUT TYPE="HIDDEN" NAME="cartname" VALUE="<%=cartname%>">
                          <INPUT TYPE="HIDDEN" NAME="exportname" VALUE="exportCSV">
                          <INPUT TYPE="HIDDEN" NAME="exportformat" VALUE="csv">
                          <TR>
						     <TD>
							    <TABLE cellpadding="0" cellspacing="0" border="0" summary="bottom" align="center">
                                   <TR>
								      <TD><IMG src="<%=request.getContextPath()%>/images/bottom_left_selected.gif" width="6" height="6" alt=""></TD>
                                      <TD class="background" width="100%"><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="100" height="1" alt=""></TD>
                                      <TD><IMG src="<%=request.getContextPath()%>/images/bottom_right_selected.gif" width="6" height="6" alt=""></TD>
                                   </TR>
                                </TABLE>
                             </TD>
                          </TR>
                       </TABLE>
					</form>
					</logic:notEqual>
              </TD>
              <!-- #### Vertical menu #### -->
              <TD valign="top" width="200" rowspan="2">
                 <BR/>
                   <FIELDSET id="formulaire" style="width: 80%; border-color: blue; border-style: outset">
        		      <LEGEND>&nbsp;Choose option&nbsp;</LEGEND>
                      <TABLE cellpadding="0" cellspacing="0" width="100%" border="0" summary="Top menu icons" class="body">
                            <TR>
                               <TD><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="24" height="1" alt="" border="0"></TD>
                               <TD align="left">
                                  <NOBR><a href="javascript:changeAction('delete');" target='_self' class='' >Delete selection</a></NOBR>
                               </TD>
                               <TD><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="24" height="1" alt="" border="0"></TD>
                            </TR>
                            <TR>
                               <TD colspan="3"><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="24" height="5" alt="" border="0"></TD>
                            </TR>
                            <TR>
                               <TD colspan="3"><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="24" height="10" alt="" border="0"></TD>
                            </TR>
                            <TR>
                               <TD><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="24" height="1" alt="" border="0"></TD>
                               <TD align="left">
                                     <NOBR><fa:mailto name="<%=cartname%>" scope="session" label="Send a mail to the list" /></NOBR>
                               </TD>
                               <TD><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="24" height="1" alt="" border="0"></TD>
                            </TR>
                            <TR>
                               <TD colspan="3"><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="24" height="5" alt="" border="0"></TD>
                            </TR>

                            <TR>
                               <TD><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="24" height="1" alt="" border="0"></TD>
                               <TD align="left">
                                  <NOBR><a href="<%=request.getContextPath()%>/exportTempList.csv?cartname=<%=cartname%>&#38;exportname=exportCSV&#38;exportformat=csv" target='_self' class='' >Export the list to CSV</a></NOBR>
                               </TD>
                               <TD><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="24" height="1" alt="" border="0"></TD>
                            </TR>
                            <TR>
                               <TD colspan="3"><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="24" height="5" alt="" border="0"></TD>
                            </TR>

                            <TR>
                               <TD><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="24" height="1" alt="" border="0"></TD>
                               <TD align="left">
                                  <NOBR><a href="javascript:changeAction('trombi');" target='_self' class='' >Photo gallery of the list</a></NOBR>
                               </TD>
                               <TD><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="24" height="1" alt="" border="0"></TD>
                            </TR>
                            <TR>
                               <TD colspan="3"><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="24" height="5" alt="" border="0"></TD>
                            </TR>
					  
					  </TABLE>
                   </FIELDSET>
              </logic:present>
              </logic:present>
              </TD>
           </TR>
        </TABLE>
    </BODY>
</HTML>



